obj=helloworld_int helloworld_syscall_gcc \
helloworld_syscall helloworld_int_gcc \
helloworld_lib_32  helloworld_lib

all: $(obj)

helloworld_syscall: helloworld_syscall.s
	as helloworld_syscall.s -o helloworld_syscall.o
	ld helloworld_syscall.o -o helloworld_syscall

helloworld_syscall_gcc: helloworld_syscall_gcc.s
	gcc -no-pie helloworld_syscall_gcc.s -o helloworld_syscall_gcc

helloworld_int:helloworld_int.s
	as helloworld_int.s -o helloworld_int.o
	ld helloworld_int.o -o helloworld_int

helloworld_int_gcc:helloworld_int_gcc.s
	gcc -no-pie helloworld_int_gcc.s -o helloworld_int_gcc

helloworld_lib_32: helloworld_lib_32.s
	as --32 helloworld_lib_32.s -o helloworld_lib_32.o
	ld -m elf_i386 -I /lib/ld-linux.so.2 -o helloworld_lib_32 \
	helloworld_lib_32.o -lc

helloworld_lib: helloworld_lib.s
	as helloworld_lib.s -o helloworld_lib.o
	ld -I /lib64/ld-linux-x86-64.so.2 -o helloworld_lib \
	helloworld_lib.o -lc

clean:
	-rm $(obj) *.o
